package org.example.zxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.example.zxy.MonitorBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MonitorController {
   // @GetMapping("/sentinel/hello")
   // public String hello(){
   //    return "hello Sentinel";
   //  }

    @GetMapping(value =  "/sentinel/hello")
    @SentinelResource(value = "helloResource",blockHandler = "helloBlockHandler",blockHandlerClass = MonitorBlockHandler.class)
    public String hello(){
        return "hello sentinel";
    }

}
